package cn.base.project.exception.custom;

import cn.base.project.exception.custom.code.ErrorCode;

/**
 * Created by Linwq on 2017/12/20.
 */
public class BaseException extends Exception{

    private static final long serialVersionUID = -5884105901660649127L;

    private String msg;
    private String errCode;
    private String data;
    private String id ;
    private String value;
    private String  reserve;


    public BaseException(ErrorCode ec, String id, String value, String data, String reserve){
        super(ec.getMessage());
        this.msg = ec.getMessage();
        this.errCode = ec.getErrorCode();
        this.id = id;
        this.data = data;
        this.reserve = reserve;
        this.value = value;
    }

    public BaseException(ErrorCode ec){
        this(ec,null,null);
    }
    public BaseException(ErrorCode ec , String data){
        this(ec,null,null,data,null);
    }
    public BaseException(ErrorCode ec, String id, String value){
        this(ec,id,value,null);
    }
    public BaseException(ErrorCode ec, String id, String value, String data){
        this(ec,id,value,data,null);
    }


    public String getMsg() {
        return msg;
    }

    public String getErrCode() {
        return errCode;
    }

    public String getData() {
        return data;
    }

    public String getId() {
        return id;
    }

    public String getValue() {
        return value;
    }

    public String getReserve() {
        return reserve;
    }
}
